function vishid()
{
    var button=document.getElementById("vishidButton");
    var login=document.getElementById("login");
    var regist=document.getElementById("regist");
    if(button.innerHTML=="注册")
    {
        button.innerHTML="登录";
        login.style.display="none";
        regist.style.display="block";
    }
    else
    {
        button.innerHTML="注册";
        login.style.display="block";
        regist.style.display="none";
    }
}

function validate_form()
{
    console.log(document.forms["loginForm"]["userid"]);
    if(document.forms["loginForm"]["userid"].value!="aa")
    {
        alert("Error!");
        return false;
    }
    else
    {
        alert("Right!");
        return true;
    }
}

function validate_form2()
{
    if(document.forms["registForm"]["password"].value=="")
    {
        ShowModel("未输入密码");
        return false;
    }
    else if(document.forms["registForm"]["password"].value!=document.forms["registForm"]["password2"].value)
    {
        ShowModel("两次密码不相同");
        return false;
    }
    else
    {
        ShowModel("提交成功");
        return true;
    }
}

//对话框
function ShowModel(content) {
    document.getElementById('i1').classList.remove('hide');
    $('#i2 a').html(content);
    document.getElementById('i2').classList.remove('hide');
}
function CancleShowModel() {
    document.getElementById('i1').classList.add('hide');
    document.getElementById('i2').classList.add('hide');
}